package info.cs52.fes.action.dish;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import info.cs52.fes.FesAction;
import info.cs52.fes.dao.DishDAO;
import info.cs52.fes.data.Dish;

public class ViewAction extends FesAction {

	private Dish dish;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String id = req.getParameter("id");
		dish = DishDAO.find(id);
		if (dish != null) {
			setTitle(dish.getName());
		}
	}
	
	public Dish getDish() {
		return dish;
	}
}
